    <style type="text/css">
    v\:* {
      behavior:url(#default#VML);
    }
    </style>
    <style type="text/css">
    div.children_wrapper
    {
    	padding: 0px 0px 0px 30px;
    	
    }
    </style>
     <!--<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA0Qhd3w3zhgZ-USc3ftv8UBR5ReOozKCrnfIoZl1Pq8mrg7k2bBSFblMKAwaf8o8xGteCzIG6_lkqqw" type="text/javascript"></script>
  	 
    <div id="map" style="width: 600px; height: 400px;"></div>
	-->

<script src="/public/library/hvn/captcha.redraw.js" type="text/javascript"></script>
<script src="/public/library/hvn/place.js" type="text/javascript"></script>
<!-- <link rel="stylesheet" href="/public/library/hvn/place.css" type="text/css">
-->
<!--

    <script type="text/javascript">

    var map = new GMap(document.getElementById("map"));
    map.centerAndZoom(new GPoint(105.83850860595703, 21.033878129041128), 10);
	map.addControl(new GLargeMapControl());
	map.openInfoWindow(map.getCenter(), document.createTextNode("Welcome to Viet Name, this is Ha noi Capital.Kuto tote"));
    var point = new GPoint(105.83850860595703, 21.033878129041128);
    var marker = new GMarker(point);
    map.addOverlay(new GMarker(new GPoint(106.65939331054688,10.75911190881616)));
    map.addOverlay(marker);
    GEvent.addListener(map, 'click', function(overlay, point) {

        if (overlay) {
            map.removeOverlay(overlay);

        } else if (point) {
            map.recenterOrPanToLatLng(point);
            var marker = new GMarker(point);
            //var marker = createMarker(point);
            //var marker = showAddress(point,citta,cap);
            map.addOverlay(marker);
        }article

     });
// Recenter Map and add Coords by clicking the map
	GEvent.addListener(map, 'click', function(overlay, point) {
            document.getElementById("latitude").value=point.y;
            document.getElementById("longitude").value=point.x;
});
</script>
-->

<script language="Javascript">

var mode = '<?= $this->mode?>';

$(function() {
    getAddress(mode);
    getCategoryType(mode);
    /*
    if($('select#category').val() == 89)
    	$('#address').hide();
    else 
    	$('#address').show();
    $('select#category').change(function(){
	    if($(this).val() == 89)
	    	$('#address').hide();
	    else
	    	$('#address').show();
    })
    */
});

</script>
<div class="successMessage"><?=$this->successMessage?></div>
<div class="errorMessage"><?=$this->errorMessage?></div>

<form id="newPlace" accept-charset="UTF-8" action="<?= $this->escape($this->form->getAction()) ?>"
      method="<?= $this->escape($this->form->getMethod()) ?>">

<?if($this->mode === 'edit') :?>
	<h1><b> <?=t(745) ?>:</b></h1>
	<ul  class="navigationTab">
	<li class="selected"> <a href="<?=$this->hvnUrl(array('module' => 'place', 'action' => 'edit-basic'))?>?id=<?=$this->id?>"> <?=t(745) ?> </a> </li>
	<li> <a href="<?=$this->hvnUrl(array('module' => 'place', 'action' => 'edit'))?>?id=<?=$this->id?>"> <?=t(746) ?> </a> </li>
	<li> <a href="<?=$this->hvnUrl(array('module' => 'place', 'action' => 'gallery'))?>?id=<?=$this->id?>"> <?=t(6) ?> </a> </li>
	<li> <a href="<?=$this->hvnUrl(array('module' => 'event', 'action' => 'new'))?>?belong_to_ids=<?=$this->id?>&belong_to_names_submit=<?=$this->placeName?>"> <?=t(221)?> </a> </li>
	<li> <a target="_blank" href="<?=$this->hvnUrl(array('module' => 'place', 'action' => 'view'))?>?id=<?=$this->id?>"> <?=t(134) ?> </a> </li>
	</ul>
<?else :?>
	<h1><b> <?=t(795) ?>:</b></h1>
	<br/>
<?endif?>

<fieldset class="expansible" ><legend><span><?=t(794) ?></span></legend>

	<table>
        <tr>
            <td><?=t(776) ?>:</td>
            <td><?= $this->form->name ?> 
                ( language:  <?= $this->form->language ?> )
            </td>
        </tr>
        <tr>
            <td><?=t(793) ?>:</td>
            <td><?= $this->form->other_name ?></td>
        </tr>
        <tr>

    	<tr>
			<td> <?=t(14) ?>:</td>
			<td><?= $this->form->category ?> &nbsp;&nbsp;&nbsp;
			<?= $this->form->rtype ?></td>
		</tr>
		<tr ><td></td><td id="sub-type"> </td></tr>
	</table>
</fieldset>


<fieldset class="expansible"><legend><span><?=t(777) ?></span></legend>
	<table>
			<td><?=t(792) ?>:</td>
			<td><?= $this->form->city_id ?></td>
		</tr>
		<tr id="district">
			<td><?=t(771) ?>:</td>
			<td><?= $this->form->district_id ?></td>
		</tr>
		<tr id="village">
			<td><?=t(789) ?>:</td>
			<td><?= $this->form->village_id ?></td>
		</tr>
		<tr>
			<td><?=t(790) ?>:</td>
			<td><?= $this->form->address5 ?></td>
		</tr>
		<tr>
			<td><?=t(791) ?>:</td>
			<td><?= $this->form->address6 ?></td>
		</tr>
		<tr>
			<td><?=t(781) ?>:</td>
			<td><?= $this->form->address7 ?></td>
		</tr>
		<tr>
			<td><?=t(783) ?>:</td>
			<td><?= $this->form->address8 ?></td>
		</tr>
		<tr>
			<td><?=t(788) ?>:</td>
			<td><?= $this->form->address9 ?></td>
		</tr>
	</table>	
</fieldset>

<?if(!empty($this->form->status)) :?>
    <?=t(2) ?>:     <?= $this->form->status ?>
<?endif?>

<?if(!empty($this->form->captcha_newplace)) :?>	
	<div> 
	<?=$this->form->captcha_newplace ?>
	<a href="javascript:void()" class="redraw"> <?=t(22) ?> </a>
	</div>
<?endif?>

<br/>
<div style="text:align:middle">
<?=$this->form->submit ?>
</div>

<?if($this->mode === 'edit' || $this->mode === 'new') :?>
	<input type="hidden" name="id" value="<?= $this->id; ?>" />

	<script type="text/javascript">
		
		$(function() {
			if($("select#rtype").val() != 0)
			{
				$("select#rtype").val(<?=$this->rtype;?>);
				$("select#rtype").trigger("change");
			}
		});
		
		function populate_category_checkboxes()
		{
			<?if(!empty($this->type)):?>
			<?foreach ($this->type as $t) :?>
				$("input:checkbox[name=type[]]").filter("[value=<?=$t?>]").trigger("click");

			    $(".parent_category_checkbox").each( function() {
                    var checked_status = this.checked;
                    if (!checked_status)
                    {
						$(this).siblings("div.children_wrapper").hide();
                 	}
                 	else
                 		$(this).siblings("div.children_wrapper").show();
        		}); 
			<?endforeach?>
			<?endif?>
		}
	</script>
<?endif?>

<?= $this->form->longitude?>
<?= $this->form->latitude?>
</form>

